package rodsays;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

import rod.RodSays;
import say.SayHello;

public class Activator implements BundleActivator {

    private ServiceRegistration serviceReg = null;


    public void start(BundleContext context) throws Exception {
        serviceReg = context.registerService(SayHello.class.getName(),
                new RodSays(), null);// 1
    }

    public void stop(BundleContext context) throws Exception {
        if (serviceReg != null)
            serviceReg.unregister();// 2
    }
}
